package ooday04.practice02;

public class Test {
    public static void main(String[] args) {

        Person[] person = new Person[3];
        Shangke shangke = new Shangke();
        person[0] = new Doctor("乔伊", 15);
        person[1] = new Teacher("木木", 15);
        person[2] = new Student("张三", 15);
        for (int i = 0; i < person.length; i++) {
            System.out.println(person[i].name);
            person[i].skill();
            shangke.shangke(person[1], person[2]);
            if (person[i] instanceof Hobby) {
                Hobby aihao = (Hobby) person[i];
                aihao.aihao();
            }

        }


    }


}
